﻿using BCDto.WeChatComponent.WeChatCustom;
using BCService.WeChatComponent.WeChatCustomService;
using Microsoft.AspNetCore.Mvc;

namespace BCTMSRESTful.Controllers.Management.WeChat
{
    /// <summary>
    /// 微信客服控制器
    /// </summary>
    [ApiExplorerSettings(GroupName = "Admin")]
    [Route("api/v1/sim/[controller]")]
    public class WeChatCustomController : ManagementBaseController
    {
        private readonly IWeChatCustomService weChatCustomService;

        public WeChatCustomController(IWeChatCustomService weChatCustomService)
        {
            this.weChatCustomService = weChatCustomService;
        }

        /// <summary>
        /// 微信留言回复。
        /// </summary>
        /// <param name="weChatCustomMessageRequestDto">微信留言回复内容</param>
        /// <response code="200">回复成功。</response>
        /// <returns></returns>
        [HttpPost("[action]")]
        [ProducesResponseType(typeof(bool), 200)]
        public IActionResult SendReply([FromBody]WeChatCustomMessageRequestDto weChatCustomMessageRequestDto)
        {
            this.weChatCustomService.SendMessage(weChatCustomMessageRequestDto);
            return this.Ok(true);
        }
    }
}
